class CartItem

  attr_reader :product_id, :quantity,:tee_size

  def initialize(product_id,tee_size,quantity=1)
    @product_id = product_id
    @quantity = quantity
    @tee_size = tee_size
  end

  def increment_quantity(quantity=1)
    @quantity += quantity
  end

  def decrement_quantity(quantity=1)
    @quantity -= quantity if @quantity >0
  end

  def name
    Product.find(@product_id).name
  end

  def price
    Product.find(@product_id).price * @quantity
  end
end